/**
 * @file es_type.h
 *
 * @brief Implement your own macro definitions.
 *
 * @author bagy
 *
 * @version V1.0
 *
 * @date 2024-05-14
 */

#ifndef  __ES_TYPE_H__
#define  __ES_TYPE_H__

#include "es_cstand.h"

/* Attribute Macros */
#ifdef __GNUC__
#define ES_DEPRECATED(msg) 							__attribute__((deprecated(msg)))
#define ES_UNUSED 									__attribute__((unused))
#define ES_PACKED 									__attribute__((packed))
#define ES_SECTION(name) 							__attribute__((section(name)))
#define ES_USED 									__root
#define ES_INLINE 									static inline
#define ES_STATIC 									static
#define ES_NO_OPTIMIZE 								__attribute__((optimize("O0")))
#define ES_VOLATILE 								volatile
#define ES_STRUCT									struct
#define ES_CONST 									const
#define ES_RESTRICT 								__restrict__
#define ES_REGISTER 								register
#define ES_ALIGNED(x) 								__attribute__((aligned(x)))
#define ES_LIKELY(x) 								__builtin_expect(!!(x), 1)
#define ES_UNLIKELY(x) 								__builtin_expect(!!(x), 0)
#define ES_FORCE_INLINE 							__attribute__((always_inline)) inline
#define ES_NO_INLINE 								__attribute__((noinline))
#define ES_WEAK                         			__attribute__((weak))
#else
#define ES_DEPRECATED(msg)
#define ES_UNUSED
#define ES_PACKED
#define ES_SECTION(name)
#define ES_USED
#define ES_INLINE 									static
#define ES_STATIC 									static
#define ES_NO_OPTIMIZE
#define ES_VOLATILE 								volatile
#define ES_STRUCT									struct
#define ES_CONST 									const
#define ES_RESTRICT
#define ES_REGISTER
#define ES_ALIGNED(x)
#define ES_LIKELY(x) (x)
#define ES_UNLIKELY(x) (x)
#define ES_FORCE_INLINE 							inline
#define ES_NO_INLINE
#define ES_WEAK
#endif

/**
 * @brief const void type.
 */
typedef const void ES_CONST_VOID;

/**
 * @brief const char type.
 */
typedef const char ES_CONST_INT8;

/**
 * @brief const unsigned char type.
 */
typedef const unsigned char ES_CONST_U8;

/**
 * @brief const int type.
 */
typedef const int ES_CONST_INT16;

/**
 * @brief const unsigned int type.
 */
typedef const unsigned int ES_CONST_U16;

/**
 * @brief void type.
 */
typedef void ES_VOID;

/**
 * @brief 8-bit unsigned integer type.
 */
typedef unsigned char ES_U8;

/**
 * @brief 8-bit signed integer type.
 */
typedef signed char ES_INT8;

/**
 * @brief 16-bit unsigned integer type.
 */
typedef unsigned short ES_U16;

/**
 * @brief 16-bit signed integer type.
 */
typedef signed short ES_INT16;

/**
 * @brief 32-bit unsigned integer type.
 */
typedef unsigned int ES_U32;

/**
 * @brief 32-bit signed integer type.
 */
typedef signed int ES_INT32;

/**
 * @brief 64-bit unsigned integer type.
 */
typedef unsigned long long ES_U64;

/**
 * @brief 64-bit signed integer type.
 */
typedef signed long long ES_INT64;

/**
 * @brief Boolean type.
 */
typedef enum
{
    ES_FALSE = 0, /**< Represents the false value. */
    ES_TRUE = 1   /**< Represents the true value. */

} ES_BOOL;


#endif   /* __ES_TYPE_H__ */
